<?php include_partial('aoiFrontPartials/contentHeader',
	array(
		'nav'=>array(
			array('url'=>url_for('homepage'),'title'=>'Accueil'),
			array('url'=>'','title'=>'Votre R&eacute;servation')
		),
		'title'=>'R&eacute;servations',
		'description'=>'Votre prochain voyage avec Comoros Airways'
	)
); ?>

<section id="content">
			<div class="container">
				
				<div id="mainbody">
					
					<div class="row">
						<div class="span12">
							<h2>Reservation n° <?php echo $reservation->getRefCode(); ?></h2>

							<?php if($reservation->getStatus() == 'created'): ?>
								<div class="alert alert-info">
		              Cette réservation est en attente de validation par nos agents. Vous recevrez par email le lien pour procéder au paiement.
		            </div>
							<?php endif; ?>
							<?php if($reservation->getStatus() == 'cancelled'): ?>
							<div class="alert alert-error">
	              Cette réservation a été annulée.
	            </div>
							<?php endif; ?>

							<h4>Liste des vols</h4>


							<?php include_partial('aoiFrontPartials/bookingReservationFlightList', array('reservation'=>$reservation)) ?>

							<h4>Passagers</h4>

							
							<?php include_partial('aoiFrontPartials/bookingReservationPassengerList', array('reservation'=>$reservation)) ?>

							<h4>Contact</h4>


							<fieldset>

						        <label>Pr&eacute;nom</label>

										<input type="text" value="<?php echo $reservation->getContactFirstname(); ?>"/>

						        <label>Nom</label>

										<input type="text" value="<?php echo $reservation->getContactLastname(); ?>"/>

						        <label>Email</label>
										<input type="text" value="<?php echo $reservation->getContactEmail(); ?>" disabled="disabled"/>

						        <label>T&eacute;l&eacute;phone</label>
										 <input type="text" value="<?php echo $reservation->getContactPhone(); ?>"/>

							</fieldset>   

							<?php if($reservation->getStatus() == 'pending' && $reservation->getAmount() > 0): ?>
							<fieldset>
								<form name="_xclick" action="<?php echo sfConfig::get('app_paypal_paymenturl') ?>" method="post">
								    <input type="hidden" name="cmd" value="_xclick">
								    <input type="hidden" name="business" value="<?php echo sfConfig::get('app_paypal_businessaccount') ?>">
								    <input type="hidden" name="currency_code" value="<?php echo $reservation->getCurrency() ?>">
								    <input type="hidden" name="item_name" value="Comoros Airlines - Reservation numero <?php echo $reservation->getRefCode(); ?>">
								    <input type="hidden" name="custom" value="reservation_id=<?php echo $reservation->getId().'&ref_code='.$reservation->getRefCode() ?>"/>
								    <input type="hidden" name="amount" value="<?php echo $reservation->getAmount() ?>">
								    <input type="hidden" name="return" value="<?php echo sfConfig::get('app_paypal_pagereturn') ?>">
								    <input type="hidden" name="notify_url" value="<?php echo sfConfig::get('app_paypal_ipnurl') ?>">
								    <input type="hidden" name="first_name" VALUE="<?php echo $reservation->getContactFirstname() ?>">
										<input type="hidden" name="last_name" VALUE="<?php echo $reservation->getContactLastname(); ?>">
										<input type="submit" value="Procéder au paiement"/>
								</form>
							</fieldset>
							<?php endif; ?>
						</div>
					</div><!-- end row -->
					
				</div><!-- end mainbody -->
				
			</div><!-- end container -->
		</section>